const urlBase = "http://127.0.0.7/";
// const urlBase = "http://111.229.146.19/";
const api = "api/ydk/";

// const urlBase = "http://127.0.0.2/";
// const api = "index.php/plugin/test/";

const Config = {};

Config.urlBase = urlBase;

// 平台参数 
Config.SetPlatForm = platform => {
	Config.platform = platform;
}

// 用户相关
Config.Global_PlatForm = "platform"
Config.Global_Payment = "payment"
Config.Global_UserInfo = "userInfo";
Config.Global_IsLogin = "isLogin";
Config.Global_Shopcart = "shopcart";

// 平台相关
Config.Platform_QQ = "qq";
Config.Platform_WX = "weixin";
Config.Platform_H5 = "h5";

// 支付接口相关
Config.Payment_ALI = "alipay";
Config.Payment_WX = "wxpay";
Config.Payment_H5 = "h5";

// 语言包
Config.languagePackage = "zh_cn";

// 下拉页面设置
Config.maxPage = 10;
Config.minPage = 1;
Config.pageClip = 1;
Config.initCurrentPage = 0;
Config.animationDuration = 200

// 获取 接口络地址
Config.GetUrl = (url) => {
	return urlBase + api + url;
}

Config.GetImageUrl = (url) => {
	return urlBase + url;
}

Config.GetPageUrl = (url, page = "index") => {
	return "/pages/" + url + "/" + page;
}

const ComponentSetting = {};

// Swiper
ComponentSetting.Swiper = {};
ComponentSetting.Swiper.indicatorDots = true;
ComponentSetting.Swiper.autoPlay = true;
ComponentSetting.Swiper.duration = 5000;
ComponentSetting.Swiper.interval = 2000;
ComponentSetting.Swiper.circular = true;
ComponentSetting.Swiper.indicatorColor = "rgba(255, 255, 255, .3)";
ComponentSetting.Swiper.indicatorActiveColor = "#ff5000"
ComponentSetting.Swiper.imageMode = "top left aspectFill" // scaleToFill || aspectFit || aspectFill || heightFix(微信小程序)

// Toast
ComponentSetting.Toast = {};
ComponentSetting.Toast.delaytime = 5000;

// Default Config
ComponentSetting.Image = {};
ComponentSetting.Image.defultImage = "../../static/image/emptyCart.jpg";

export {
	Config,
	ComponentSetting
}
